<template>
  <div class="container">
    <div class="background-image"></div>
    <div class="content">
      <h1 class="title">欢迎进入宠物星球</h1>
      <el-button type="primary" @click="goToLogin" class="login-button">登录</el-button>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    goToLogin() {
      this.$router.push('/login');
    },
  },
};
</script>

<style scoped>
.container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: #000; /* 备用背景颜色 */
}

.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('@/assets/background.jpg'); /* 使用相对路径引入图片 */
  background-size: cover;
  background-position: center;
  opacity: 0.8; /* 根据需要调整透明度 */
}

.content {
  position: relative;
  z-index: 1;
  color: #fff;
}

.title {
  font-size: 3em;
  margin-bottom: 20px;
  color: #FFD700; /* 字体颜色改为金色，与背景相符合 */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* 字体阴影 */
}

.login-button {
  background-color: #FFD700; /* 按钮颜色改为金色 */
  border-color: #FFD700;
  color: #000;
  font-size: 1.2em;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.login-button:hover {
  background-color: #FFC107;
  border-color: #FFC107;
}

.el-button {
  margin-right: 10px;
  width: 45%;
}
</style>
